﻿namespace Blaze.Framework.MonoEventListeners
{
    using UnityEngine;

    public class Collision2D : MonoBehaviour
    {
        public event Collision2DEventHandler OnCollisionEnter2DEvent;

        public event Collision2DEventHandler OnCollisionExit2DEvent;

        public event Collision2DEventHandler OnCollisionStay2DEvent;

        private void OnCollisionEnter2D(UnityEngine.Collision2D collision)
        {
            if (OnCollisionEnter2DEvent != null)
                OnCollisionEnter2DEvent(gameObject, collision);
        }

        private void OnCollisionExit2D(UnityEngine.Collision2D collision)
        {
            if (OnCollisionExit2DEvent != null)
                OnCollisionExit2DEvent(gameObject, collision);
        }

        private void OnCollisionStay2D(UnityEngine.Collision2D collision)
        {
            if (OnCollisionStay2DEvent != null)
                OnCollisionStay2DEvent(gameObject, collision);
        }
    }
}